package com.awaken;

import java.util.Iterator;
import java.util.List;
import java.util.LinkedList;

/**
 * User: neveragny
 * Date: 08.04.2010
 */
public class Missed {

    private List<String> missedAlarms;

    public Missed(){
        missedAlarms = new LinkedList<String>();
    }


    public void setMissedAlarms(List<String> missedAlarms) {
        this.missedAlarms = missedAlarms;
    }

    public List<String> getMissedAlarms() {
        if(this.getLength() == 0){
            System.out.println("null returned");
            return null;
        }else{
            return missedAlarms;
        }
    }

    public int getLength(){
        return missedAlarms.size();
    }

    public void add(String s){
        missedAlarms.add(s);
    }

    public void deletedByTitle(String title){
        for (Iterator<String> iterator = missedAlarms.iterator(); iterator.hasNext(); ){
            iterator.next();
            if (title.equals(title)){
                iterator.remove();
            }
        }
        System.out.println("afterDelete missedAlarms size is" + missedAlarms.size());
    }



}